<?php
//网站目录
$www_file='/www/web/wwwroot/default/wifi';
$client_ip = $_SERVER['REMOTE_ADDR'];

$fs = fopen($www_file.'/hooks.log', 'a');
fwrite($fs, '================ Update Start ==============='.PHP_EOL.PHP_EOL);
fwrite($fs, 'Request on ['.date("Y-m-d H:i:s").'] from ['.$client_ip.']'.PHP_EOL);


$output = exec("cd $www_file && git pull git@git.oschina.net:GeekShopTeam/wifi.git master   >> hooks.log  2>&1");

fwrite($fs, 'Info:'. $output.PHP_EOL);
fwrite($fs,PHP_EOL. '================ Update End ==============='.PHP_EOL.PHP_EOL);
  
$fs and fclose($fs);